﻿/*
 * This software is the confidential and proprietary
 * information of NetBay
 * Such confidential information should not be disclosed
 * NetBay copyright(c) 2010
 */

#region Using
using System;
using System.ServiceModel.DomainServices.Server;
using System.Web;

#endregion

namespace Rio.Applications.Web.Services
{
    public partial class BusinessEntitiesDomainService : DomainService
    {

        /// <summary>
        /// Set the culture info for the current user culture
        /// </summary>
        /// <param name="p_szCulture">label to translate</param>
        [Invoke]
        public void SetCulture(string p_szCulture)
        {
            try
            {
                HttpContext.Current.Session[ParameterSession.Culture.szGetDescription()] = p_szCulture;
            }
            catch (Exception ex)
            {
                System.Console.WriteLine(GetType().FullName + "(p_szCulture<" + p_szCulture + ">) EXCEPTION -> " + Environment.NewLine + ex.Message);
            }
        }

        /// <summary>
        /// Get the culture info 
        /// </summary>
        [Invoke]
        public string GetCulture()
        {
            if (HttpContext.Current.Session[ParameterSession.Culture.szGetDescription()] != null)
                return HttpContext.Current.Session[ParameterSession.Culture.szGetDescription()].ToString();
            return string.Empty;
        }

    }
}